#include "StdAfx.h"
#include "Renderer.h"
#include <math.h>

Renderer* Renderer::ms_pInstance;

void Renderer::Init ()
{
	// Set up the matrixes
	m_camMatrix.SetIdentity();

	// Hard-coded because I have no plan to extend further
	Matrix tmp;
	tmp.SetRotationX(PI/4.0f);						m_camMatrix = m_camMatrix * tmp;
	tmp.SetTranslation(0.0f, -10.0f, -40.0f);		m_camMatrix = m_camMatrix * tmp;
	tmp.SetPerspective(0.79, 1.0, 0.1, 10000);		m_camMatrix = m_camMatrix * tmp;

	// Shader
	m_shader.Init("../Resources/Shaders/TriangleShaderVS.vs", "../Resources/Shaders/TriangleShaderFS.fs");

	glClearColor( 1.0f, 1.0f, 1.0f, 1.0f );
	glEnable(GL_CULL_FACE);
	//glEnable(GL_DEPTH_TEST);
	glEnable(GL_BLEND);
	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}

Shaders* Renderer::GetShader ()
{
	return &m_shader;
}

Matrix Renderer::GetCamMatrix ()
{
	return m_camMatrix;
}

GLuint* Renderer::GetModel ()
{
	return m_boIds;
}